"""
Description:
Version: 2.0
Autor: zyw
Date: 2021-12-23 09:19:49
LastEditors: zyw
LastEditTime: 2022-01-10 16:51:33
"""

import os
import sys
from configparser import ConfigParser

base_path = os.path.abspath(os.path.join(os.getcwd(), "."))
sys.path.append(base_path)
from common.hand_path import conf_path


class ConFig(ConfigParser):
    """在创建对象时，直接加载配置文件中的内容"""

    def __init__(self, conf_file):
        super().__init__()
        self.read(conf_file, encoding='utf-8')


conf = ConFig(os.path.join(conf_path, 'conf.ini'))

if __name__ == '__main__':
    conf = ConFig(r'C:\Users\Administrator\Desktop\Erpinterface\interface_test_qkc\conf\conf.ini')
    name = conf.get('header', 'login_header')
    print(name)
